import React from 'react';
import { connect } from 'react-redux';
import * as types from '../store/action_types'
import { minus } from '../store/actions'
class Color extends React.Component {
  render() {
    return <div className=''>
      <input type="color" onChange={(e) => {
        this.props.changeColor(e.target.value)
      }} />
      <button onClick={() => {
        this.props.minus()
      }}>-</button>
    </div>;
  }
}
Color = connect(() => ({}), (dispatch) => {
  return {
    changeColor(col) {
      dispatch({ type: types.CHANGECOLOR, col: col })
    },
    minus() {
      dispatch(minus())
    }
  }
})(Color)
export default Color